import Vue from 'vue'
import Router from 'vue-router'
import AppIndex from '@/page/AppIndex'
import AppScanQR from '@/page/AppScanQR'
import AppUserMessage from '@/page/AppUserMessage'
import AppMyInfo from '@/page/AppMyInfo'

Vue.use(Router)

const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}

export default new Router({
  routes: [
    {
      path: '/',
      name: 'AppIndex',
      component: AppIndex
    },
    {
      path: '/appScanQR',
      name: 'AppScanQR',
      component: AppScanQR
    },
    {
      path: '/appUserMessage',
      name: 'AppUserMessage',
      component: AppUserMessage
    },
    {
      path: '/appMyInfo',
      name: 'AppMyInfo',
      component: AppMyInfo
    }
  ]
})
